﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel;

namespace Enter.Mvc.Mall.Model.User
{
    public class UserInfo
    {
        public enum EnumUserType : byte
        {
            /// <summary>
            /// 普通用户
            /// </summary>
            [Description("普通用户")]
            Common,
            /// <summary>
            /// 商家
            /// </summary>
            [Description("商家")]
            Sell
        }
        public int UserID { get; set; }
        public string UserName { get; set; }
        public string IP { get; set; }
        private string _AreaNo = "2302";

        public string AreaNo
        { get { return _AreaNo; }
            set { _AreaNo = value; }
        }
        public EnumUserType UserType { get; set; }
        public string ShopNo { get; set; }
        public static UserInfo CurrentUser
        {
            get { return System.Web.HttpContext.Current.Session["CurrentUser"] as UserInfo; }
            set { System.Web.HttpContext.Current.Session["CurrentUser"] = value; }
        }
        public static bool isLogin
        { 
            get{return CurrentUser==null?false:true;}
        
        }
      
    }


    public class LogOnModel
    {
        [Required]
        [Display(Name = "用户名")]
        public string UserName { get; set; }

        [Required]
        [DataType(DataType.Password)]
        [Display(Name = "密　码")]
        public string Password { get; set; }

        [Required]
        [Display(Name = "验证码")]
        public string ValidateCode { get; set; }
    }
    public class RegisterModel
    {
       
        public string UserName { get; set; }
        public string Password { get; set; }
        public string ConfirmPassword { get; set; }
        public string Phone { get; set; }
        public string ValidateCode { get; set; }
    }
}
